<?php

declare(strict_types=1);

namespace App\Library\Task\library\queue\drivers\redis;


use App\Library\Task\library\queue\drivers\DriverServerImp;

class QueueServerRedis implements DriverServerImp {

    private $_queuedb;

    public function __construct() {
        $this->_queuedb = new QueueDBRedis();
    }

    /**
     * 取出队列
     * @param unknown $key
     */
    public function pop($key, $time) {
        $result = $this->_queuedb->pop($key, $time);

        return $result ? unserialize($result) : [];
//        return unserialize($this->_queuedb->pop($key, $time));
    }

    public function scan($driver = 'default') {
        return $this->_queuedb->scan( $driver );
    }

    public function clear( $driver = 'default' ) {
        return $this->_queuedb->clear( $driver );
    }

}